<template>
  <div>
    <el-form
      ref="form"
      :size="'medium'"
      :model="form"
      label-width="125px"
      v-loading="loading"
      disabled
    >
      <el-row>
        <el-col :span="12">
          <el-form-item label="站点名称" prop="stationName">
            <el-input
              v-model="form.stationName"
              placeholder="请输入站点名称"
              suffix-icon="xxx"
            />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="站点类型" prop="stationType">
            <el-select
              v-model="form.stationType"
              placeholder="请选择站点类型"
              clearable
            >
              <el-option
                v-for="dict in statusOptions"
                :key="dict.dictValue"
                :label="dict.dictLabel"
                :value="dict.dictValue"
              />
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="12">
          <el-form-item label="电压等级" prop="kv">
            <el-select
              v-model="form.kv"
              placeholder="请选择电压等级"
              clearable
            >
              <el-option
                v-for="dict in KVOptions"
                :key="dict.dictValue"
                :label="dict.dictLabel"
                :value="dict.dictValue"
              />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="供电公司" prop="area">
            <el-select
              v-model="form.area"
              placeholder="请选择供电公司"
              clearable
            >
              <el-option
                v-for="dict in areaOptions"
                :key="dict.dictValue"
                :label="dict.dictLabel"
                :value="dict.dictValue"
              />
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="联系电话" prop="tel">
            <el-input
              v-model="form.tel"
              placeholder="请输入联系电话"
              suffix-icon="xxx"
            />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="光缆出口数量" prop="opticalOutNum">
            <el-input-number
              v-model="form.opticalOutNum"
              placeholder="请输入"
              suffix-icon="xxx"
            ></el-input-number>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="11">
          <el-form-item label="经纬度" prop="longitude">
            <el-input
              v-model="form.longitude"
              placeholder="请输入经度"
              suffix-icon="xxx"
            />
          </el-form-item>
        </el-col>
        <el-col :span="6" class="ml10">
          <el-form-item label-width="0" prop="latitude">
            <el-input
              v-model="form.latitude"
              placeholder="请输入纬度"
              suffix-icon="xxx"
            />
          </el-form-item>
        </el-col>
      </el-row>
      <!-- <el-row>
        <el-col :span="12">
          <el-form-item label="传输网上联速率" prop="networkRate">
            <el-select
              v-model="form.networkRate"
              placeholder="请选择"
              clearable
            >
              <el-option
                v-for="dict in rateOptions"
                :key="dict.dictValue"
                :label="dict.dictLabel"
                :value="dict.dictValue"
              />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="传输网下联带宽" prop="networkBw">
            <el-select
              v-model="form.networkBw"
              placeholder="请选择"
              clearable
            >
              <el-option
                v-for="dict in bwOptions"
                :key="dict.dictValue"
                :label="dict.dictLabel"
                :value="dict.dictValue"
              />
            </el-select>
          </el-form-item>
        </el-col>
      </el-row> -->
      <el-row>
        <el-col :span="24">
          <el-form-item label="产权单位" prop="propertyUnit">
            <el-input
              v-model="form.propertyUnit"
              placeholder="请输入产权单位"
              suffix-icon="xxx"
            />
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </div>
</template>

<script>
import { getStation } from '@/api/station/station'
export default {
  props: ['id'],
  data() {
    return {
      statusOptions: [],
      areaOptions: [],
      //调度等级
      levelOptions: [],
      //电压等级
      KVOptions: [],
      //上传速率
      rateOptions: [],
      //下载速率
      bwOptions: [],
      // 表单参数
      form: {
        longitude: '',
        latitude: '',
      },
      loading: false,
    }
  },
  created() {},
  mounted() {
    this.loading = true
    getStation(this.id).then((response) => {
      this.form = response.data
      this.loading = false
    })
    this.getDicts('station_type').then((response) => {
      this.statusOptions = response.data
    })
    this.getDicts('area').then((response) => {
      this.areaOptions = response.data
    })
    this.getDicts('dispatch_level').then((response) => {
      this.levelOptions = response.data
    })
    this.getDicts('KV').then((response) => {
      this.KVOptions = response.data
    })
    this.getDicts('network_rate').then((response) => {
      this.rateOptions = response.data
    })
    this.getDicts('network_bw').then((response) => {
      this.bwOptions = response.data
    })
  },
  methods: {},
}
</script>

<style scoped></style>
